import socket, threading, CrazyProtocol, CarzyDict
from server_thread import server_target
SERVER_PORT =30000
clients = CarzyDict.CrazyDict()
s=socket.socket()
try:
    s.bind(("localhost",SERVER_PORT))
    s.listen()
    while True:
        c,addr=s.accept()
        threading.Thread(target=server_target,args=(c,clients)).start()
except:
    print("服务器启动失败，端口%s是否被占用" % SERVER_PORT)